package ms.unicorn.dsl.utils;

import org.eclipse.emf.ecore.EObject;

import ms.unicorn.dsl.runtime.ExecutionContext;

public class SphynxInvalidOperator extends SphynxRuntimeException {

	private static final long serialVersionUID = 1L;

	public SphynxInvalidOperator(ExecutionContext context, EObject element, String operator, Object left, Object right) {
		super(context, element, String.format("Operator '%s' is not applicable between type '%s' and '%s'", operator, 
					left != null ?left.getClass().getName():"null", right != null ? right.getClass().getName() : "null"));
	}

	public SphynxInvalidOperator(ExecutionContext context, EObject element, String operator, Object left) {
		super(context, element, String.format("Operator '%s' is not applicable for type '%s'", operator, 
				left != null ? left.getClass().getName():"null" ));
	}
}
